/*
 * 版权所有 (C) 2013 长沙市红耀通信息技术有限公司。保留所有权利。
 *
 * http://www.zhiqim.com/fadfox/ 欢迎加盟[知凡狐]兴趣小组。
 *
 * 创建说明： 2013-6-29 由 zhichenggang创建
 */
package net.redxyz.repost.resource.action.plan;

import net.redxyz.top.repost.dbo.AssRepostPlan;
import net.redxyz.top.repost.dbo.AssRepostPlanDetail;

import org.zhiqim.httpd.HttpRequest;
import org.zhiqim.httpd.context.core.Action;
import org.zhiqim.orm.ORM;
import org.zhiqim.orm.dbo.Selector;

/**
 * 均衡上下架计划删除
 *
 * @version v7.0.1 @author zouzhigang 2021-7-29 新建与整理
 */
public class RepostPlanDeleteAction implements Action
{

    public void execute(HttpRequest request) throws Exception
    {
        // 删除计划和计划详情
        String planId = request.getParameter("planId");

        Selector selector = new Selector("planId", planId);
        selector.addReplace("d", "001");
        ORM.table().delete(AssRepostPlanDetail.class, selector);

        ORM.table().delete(AssRepostPlan.class, planId);
    }
}
